FROM openjdk:21-jdk
LABEL authors="Alexander"
# 设置工作目录
WORKDIR /home/weather_spider
# 复制jar包及配置文件到容器内
COPY weather_spider.jar /home/weather_spider/weather_spider.jar
COPY *.yaml /home/weather_spider/
# 设置容器启动命令
CMD ["java", "-jar", "/home/weather_spider/weather_spider.jar"]
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone